package com.hudson.plugin;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * PromotionBuilds entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "promotion_builds", catalog = "reportdb")
public class PromotionBuilds implements java.io.Serializable {

    // Fields

    private Integer id;
    private Promotions promotions;
    private String promotionNum;
    private String author;
    private String result;
    private Integer duration;
    private String buildOn;

    // Constructors

    /**
     * default constructor
     */
    public PromotionBuilds() {
    }

    /**
     * full constructor
     */
    public PromotionBuilds(Promotions promotions, String promotionNum,
                           String author, String result, Integer duration, String buildOn) {
        this.promotions = promotions;
        this.promotionNum = promotionNum;
        this.author = author;
        this.result = result;
        this.duration = duration;
        this.buildOn = buildOn;
    }

    // Property accessors
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "promotion_id")
    public Promotions getPromotions() {
        return this.promotions;
    }

    public void setPromotions(Promotions promotions) {
        this.promotions = promotions;
    }

    @Column(name = "promotion_num", length = 32)
    public String getPromotionNum() {
        return this.promotionNum;
    }

    public void setPromotionNum(String promotionNum) {
        this.promotionNum = promotionNum;
    }

    @Column(name = "author", length = 32)
    public String getAuthor() {
        return this.author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    @Column(name = "result", length = 12)
    public String getResult() {
        return this.result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    @Column(name = "duration")
    public Integer getDuration() {
        return this.duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }

    @Column(name = "build_on", length = 256)
    public String getBuildOn() {
        return this.buildOn;
    }

    public void setBuildOn(String buildOn) {
        this.buildOn = buildOn;
    }

}